<template>
	<view class="content">
		<image class="logo" src="/static/logo.png"></image>
		<view class="text-area">
			<text class="title">{{title}}</text>
			<text>{{displayLength}}</text>
		</view>
		<view class="text-area" v-for="(item,index) in displayArr" :key="index">
			<text>{{item}}</text>
		</view>
		<view class="button-test">
			<button size="mini" :disabled="false" hover-start-time=20 @click="initClass">测试按钮</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '测试',
				displayLength:0,
				displayArr:[]
			}
		},
		onLoad() {

		},
		methods: {
			scanCode(){
				uni.scanCode({
				    success: function (res) {
				        console.log('条码类型：' + res.scanType);
				        console.log('条码内容：' + res.result);
				    }
				});
			},
			initClass(){
				var display = plus.android.importClass('android.hardware.display.DisplayManager');
				var arr_display = display.getDisplays();
				this.displayLength = arr_display.length;
				this.displayArr = arr_display;
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
	.button-test{
		padding: 30rpx 0;
	}
</style>
